package com.cmj.domain;

/**
 * 响应格式的枚举类
 */
public enum AppHttpCodeEnum {
    // 成功
    SUCCESS(200,"操作成功"),
    // 登录
    NEED_LOGIN(401,"需要登录后操作"),
    NO_OPERATOR_AUTH(403,"无权限操作"),
    SYSTEM_ERROR(500,"出现错误"),
    USERNAME_EXIST(501,"用户名已存在"),
    NICKNAME_EXIST(508,"昵称已存在"),
    EMAIL_EXIST(509,"邮箱已存在"),
    PHONE_EXIST(502,"手机号已存在"),
    REQUIRE_USERNAME(504, "必需填写用户名"),
    LOGIN_ERROR(505,"用户名或密码错误"),
    REQUIRE_NICKNAME(506,"必须填写昵称"),
    REQUIRE_EMAIL(507,"必须填写邮箱"),
    REQUIRE_PASSWORD(510,"必须填写密码"),
    CONTENT_NOT_NULL(500,"评论内容不能为空");
    int code;
    String msg;

    AppHttpCodeEnum(int code, String errorMessage){
        this.code = code;
        this.msg = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}

